/** When your routing table is too long, you can split it into small modules **/

import Layout from "@/layout";

const projectManagementRouter = {
  path: "/projectmanagement",
  component: Layout,
  redirect: "/projectmanagement/project/list",
  alwaysShow: true, // will always show the root menu
  name: "Project Management",
  meta: {
    title: "科研项目管理",
    icon: "documentation",
  },
  children: [
    {
      path: "/project",
      component: () => import("@/views/project-management/project/Index"),
      redirect: "/projectmanagement/project/list",
      children: [
        {
          path: "create",
          component: () => import("@/views/project-management/project/Create"),
          name: "CreateProject",
          hidden: true,
          meta: { title: "新增项目",
            permission: "项目信息：创建",
          },
        },
        {
          path: "edit/:id(\\d+)",
          component: () => import("@/views/project-management/project/Edit"),
          name: "EditMachineProject",
          meta: {
            title: "编辑项目信息",
            permission: "项目信息：浏览",
            noCache: true,
            activeMenu: "/project/list",
          },
          hidden: true,
        },
        {
          path: "view/:id(\\d+)",
          component: () => import("@/views/project-management/project/View"),
          name: "ViewProject",
          meta: {
            title: "查看项目信息",
            permission: "项目信息：浏览",
            noCache: true,
            activeMenu: "/project/view",
          },
          hidden: true,
        },
        {
          path: "list",
          component: () => import("@/views/project-management/project/List"),
          name: "ProjectList",
          meta: { title: "所有项目信息",
            permission: "项目信息：浏览",
          },
        },
      ],
    },
    {
      path: "/projectdeclare",
      component: () => import("@/views/project-declare/Index"),
      redirect: "/projectdeclare/list",
      children: [
        {
          path: "create",
          component: () => import("@/views/project-declare/Create"),
          name: "CreateProjectdeclare",
          hidden: true,
          meta: { title: "申请立项",
            permission: "项目信息：创建",
          },
        },
        {
          path: "/project/create/:id/declare/:title",
          component: () => import("@/views/project-management/project/Create"),
          name: "CreateNewProject",
          hidden: true,
          meta: {
            title: "申请立项",
            permission: "项目信息：创建",
          },
        },
        {
          path: "create",
          component: () => import("@/views/project-declare/Create"),
          name: "CreateProjectDeclare",
          hidden: true,
          meta: { title: "新增项目申报",
            permission: "项目申报信息：创建",
          },
        },
        {
          path: "edit/:id(\\d+)",
          component: () => import("@/views/project-declare/Edit"),
          name: "EditProjectDeclare",
          meta: {
            title: "编辑项目申报信息",
            permission: "项目申报信息：更新",
            noCache: true,
            activeMenu: "/projectdeclare/list",
          },
          hidden: true,
        },
        {
          path: "view/:id(\\d+)",
          component: () => import("@/views/project-declare/View"),
          name: "ViewProjectDeclare",
          meta: {
            title: "查看项目申报信息",
            permission: "项目申报信息：浏览",
            noCache: true,
            activeMenu: "/projectdeclare/view",
          },
          hidden: true,
        },
        {
          path: "list",
          component: () => import("@/views/project-declare/List"),
          name: "ProjectDeclareList",
          meta: {
            title: "项目申报",
            permission: "项目申报信息：浏览",
          },
        },
      ],
    },

    {
      path: "/project/subject/list",
      component: () =>
          import("@/views/project-management/project-approval/SubjectList.vue"),
      name: "Subject",
      meta: { title: "项目开题",
        permission: "项目信息：创建",
      },
    },
    {
      path: "/project/subject/report/:id(\\d+)",
      component: () =>
          import("@/views/project-management/project-approval/SubjectReport.vue"),
      name: "SubjectReport",
      hidden: true,
      meta: { title: "项目开题报告提交",
        permission: "项目信息：创建",
      },
    },
    {
      path: "/project/mid/list",
      component: () =>
        import("@/views/project-management/project-approval/MidList"),
      name: "Mid",
      meta: { title: "项目中检",
        permission: "项目信息：创建",
      },
    },
    {
      path: "/project/report/view/:id(\\d+)",
      component: () =>
        import("@/views/project-management/project-approval/View"),
      name: "Mid",
      hidden: true,
      meta: { title: "项目报告",
        permission: "项目信息：浏览",
      },
    },
    {
      path: "/project/mid/report/:id(\\d+)",
      component: () =>
        import("@/views/project-management/project-approval/MidReport"),
      name: "MidReport",
      hidden: true,
      meta: { title: "项目中检报告提交",
        permission: "项目信息：浏览",
      },
    },
    {
      path: "/project/final/list",
      component: () =>
        import("@/views/project-management/project-approval/FinalList"),
        name: "Final",
        meta: { title: "项目结项",
          permission: "项目信息：创建",
      },
    },
    {
          path: "/project/final/report/:id(\\d+)",
          component: () =>
            import("@/views/project-management/project-approval/FinalReport"),
          name: "FinalReport",
          hidden: true,
          meta: { title: "项目结项报告提交",
            permission: "项目信息：浏览",
      },
    },
    {
      path: "/project/approve/preapprove/:id(\\d+)",
      component: () =>
        import("@/views/project-management/project/PreApprove"),
      name: "Pre Approve",
      hidden: true,
      meta: { title: "项目立项预审",
        permission: "项目信息审批：预审",
      },
    },
    {
      path: "/project/approve/ethicapprove/:id(\\d+)",
      component: () =>
        import("@/views/project-management/project/EthicApprove"),
      name: "Ethic Approve",
      hidden: true,
      meta: { title: "项目立项伦理审批",
        permission: "项目信息审批：伦理",
      },
    },
    {
      path: "/project/approve/finalapprove/:id(\\d+)",
      component: () => import("@/views/project-management/project/FinalApprove"),
      name: "Final Approve",
      hidden: true,
      meta: { title: "项目立项总审批",
        permission: "项目信息审批：总审批",
      },
    },
    {
      path: "/project/approve/costapprove/:id(\\d+)",
      component: () => import("@/views/project-management/project/CostApprove"),
      name: "Cost Approve",
      hidden: true,
      meta: { title: "项目立项经费审批",
        permission: "项目信息审批：经费审批",
      },
    },
    {
      path: "/project/approve/changeapprove/:id/change/:changeid",
      component: () =>
        import("@/views/project-management/project/ChangeApprove"),
      name: "Change Approve",
      hidden: true,
      meta: { title: "项目变更审批",
        permission: "项目信息：变更",
      },
    },
    {
      path: "/project/approve/midapprove/:id(\\d+)",
      component: () => import("@/views/project-management/project-approval/MidCheck"),
      name: "Mid Approve",
      hidden: true,
      meta: { title: "项目中检审批",
        permission: "项目审批：中检",
      },
    },
    {
      path: "/project/approve/endapprove/:id(\\d+)",
      component: () => import("@/views/project-management/project-approval/FinalCheck"),
      name: "End Approve",
      hidden: true,
      meta: { title: "项目结项审批",
        permission: "项目审批：结项",
      },
    },
    // {
    //   path: "/project/change/list",
    //   component: () =>
    //     import("@/views/project-management/project-change/List"),
    //   name: "Update List",
    //   meta: { title: "项目变更",
    //     permission: "项目审批：浏览",
    //   },
    // },
    // {
    //   path: "/project/change/:id(\\d+)",
    //   component: () =>
    //     import("@/views/project-management/project-change/View"),
    //   name: "View",
    //   hidden: true,
    //   meta: { title: "查看变更项目",
    //     permission: "项目审批：浏览",
    //   },
    // },
    // {
    //   path: "/project/change/create/:id(\\d+)",
    //   component: () =>
    //     import("@/views/project-management/project-change/Create"),
    //   name: "Create",
    //   hidden: true,
    //   meta: { title: "申请变更项目",
    //     permission: "项目审批：浏览",
    //   },
    // },
    {
      path: "/project/approve/list",
      component: () => import("@/views/project-management/project/ApproveList"),
      name: "ProjectApproveList",
      meta: {
        title: "项目审批",
        permission: "项目审批：浏览",
      },
    },
  ],
};

export default projectManagementRouter;
